package com.ruoyi.system.util;


import lombok.Getter;

/**
 * @author wangy
 * @date 2020/8/10 11:52
 * 自定义异常
 */
@Getter
public class BusinessException extends RuntimeException {

    private Integer code;

    private String message;

//    public BusinessException(String message) {
//        this.code = 500;
//        this.message = message;
//    }

    public BusinessException(CodeEnum codeEnum) {
        this.code = codeEnum.getCode();
        this.message = codeEnum.getMessage();
    }

    public BusinessException(Integer code, String message) {
        super();
        this.code = code;
        this.message = message;
    }
}
